package com.ctyon.watchmanager.model.net.entity;

import com.ctyon.common.util.DataUtil;

import static com.ctyon.watchmanager.config.OssConfig.bucketName;
import static com.ctyon.watchmanager.config.OssConfig.endpoint;
import static com.ctyon.watchmanager.config.OssConfig.picture;

/**
 * CreateDate：19-7-1 on 下午7:18
 * Describe:
 * Coder: lee
 */
public class Manager {
    /**
     * managerId : 10002
     * nickName : 17722597786
     * phoneNumber : 17722597786
     * password : 123456789
     * registTime : 1561974426000
     * watchList : [{"meid":"10000","step":0,"battery":0,"forbidden":null,"sos":null,"isProtct":0,"locationType":0,"contacts":null}]
     */
    private long managerId;
    private String nickName;
    private String phoneNumber;
    private String password;
    private String img;
    private long registTime;

    public long getManagerId() {
        return managerId;
    }

    public void setManagerId(long managerId) {
        this.managerId = managerId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public long getRegistTime() {
        return registTime;
    }

    public void setRegistTime(long registTime) {
        this.registTime = registTime;
    }

    public String getImg() {
        return DataUtil.isEmptyAnd(img) ? endpoint.replace("http://", "https://ctyon.") + "/" + picture + phoneNumber + ".png" : img;
    }

    public void setImg(String img) {
        this.img = img;
    }


    @Override
    public String toString() {
        return "LoginResponse{" +
                "managerId=" + managerId +
                ", nickName='" + nickName + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", password='" + password + '\'' +
                ", img='" + img + '\'' +
                ", registTime=" + registTime +
                '}';
    }
}
